//
//  RootView.swift
//  WechatApp
//
//  Created on 2024.
//

import SwiftUI

struct RootView: View {
    @State private var selectedTab = 0
    
    var body: some View {
        TabView(selection: $selectedTab) {
            HomeView()
                .tabItem {
                    Label("微信", systemImage: selectedTab == 0 ? "message.fill" : "message")
                }
                .tag(0)
            
            ContactsView()
                .tabItem {
                    Label("通讯录", systemImage: selectedTab == 1 ? "person.2.fill" : "person.2")
                }
                .tag(1)
            
            DiscoverView()
                .tabItem {
                    Label("发现", systemImage: selectedTab == 2 ? "safari.fill" : "safari")
                }
                .tag(2)
            
            MeView()
                .tabItem {
                    Label("我", systemImage: selectedTab == 3 ? "person.fill" : "person")
                }
                .tag(3)
        }
        .accentColor(Color(red: 0.03, green: 0.76, blue: 0.38)) // WeChat Green #07C160
    }
}

#Preview {
    RootView()
}

